package com.dankegongyu.shell.js;

import android.app.Application;

import com.dankegongyu.basic.service.manager.DKEnv;
import com.dankegongyu.basic.service.manager.DKSdkService;
import com.dankegongyu.basic.service.manager.DKServiceManager;


/**
 */
public class ShellApplication extends Application {


    @Override
    public void onCreate() {
        super.onCreate();
//        DKGlobalContext.setApplication(this);
        initRuntimeConfig();
        initSDKConfig();
    }


    /**
     * 初始化sdk
     */
    private void initSDKConfig() {

        String initEnv = "DEBUG";
        DKEnv env = DKEnv.getEnv(initEnv);
        DKSdkService initSdkService = DKServiceManager.getSdkService();
        initSdkService.addSdk(new SDKX5());
        initSdkService.run(this, env);

    }

    /**
     * 初始化运行时配置
     */
    private void initRuntimeConfig() {
//        String initEnv = "DEBUG";
//        DKEnv env = DKEnv.getEnv(initEnv);
//        InitRuntimeService runtimeService = InitServiceManager.getInitRuntimeService();
//        runtimeService.addRuntime(IInitRuntimeBase.class, new InitRuntimeBase(this, env));
//        runtimeService.addRuntime(IInitRuntimeApi.class, new InitRuntimeApi(this, env));
//        runtimeService.addRuntime(IInitRuntimeHeader.class, new InitRuntimeHeader(this, env));
//        runtimeService.addRuntime(IInitRuntimeSdk.class, new InitRuntimeSdk(this, env));
    }

}
